﻿using UnityEngine;
using System.Collections;

public class InputUI : MonoBehaviour
{

    // Update is called once per frame
    void Update()
    {
        transform.position = Camera.main.ScreenToWorldPoint(Input.mousePosition);
    }

    void OnTriggerStay2D(Collider2D Obj)
    {
        if (Obj.gameObject.tag == "Cover")
        {
            InputMgr.GetInstance().m_MouseInputState = MOUSEINPUT_STATE.DENIDED;
            gameObject.GetComponent<SpriteRenderer>().color = Color.red;
        }
        else
        {
            if (Obj.gameObject.tag == "CoverCol")
            {
                InputMgr.GetInstance().m_MouseInputState = MOUSEINPUT_STATE.FULLCOVER;
                gameObject.GetComponent<SpriteRenderer>().color = Color.green;
            }
        }
        

        
    }

    void OnTriggerExit2D(Collider2D Obj)
    {
        if (InputMgr.GetInstance().m_MouseInputState != MOUSEINPUT_STATE.SUPPLY)
        {
            InputMgr.GetInstance().m_MouseInputState = MOUSEINPUT_STATE.NORMAL;
            gameObject.GetComponent<SpriteRenderer>().color = Color.white;
        }
    }


}
